<template>
    <div>
            <van-nav-bar
                title="不凡"
                left-text="返回"
                @click-left="onClickLeft"
                />
                <p class="opinion-title">意见与反馈</p>
                <van-field
                    v-model="message"
                    rows="7"
                    autosize
                    label="留言"
                    type="textarea"
                    maxlength="50"
                    placeholder="请输入留言"
                    show-word-limit
                    />
                    <van-field v-model="tel" type="tel" size="large" label="手机号" />
                    <div class="button">

                   <van-button type="primary" size="large" @click="sub">提交</van-button>
                    </div>
    </div>
</template>

<script>
import {submitAction} from "../../../api/my/index.js"
import { Toast } from 'vant';
    export default {
        data() {
            return {
                    message:"",
                    tel:"",

            }
        },
        methods:{
            onClickLeft(){
                    this.$router.go(-1)
            },
            sub(){
                  var openId = localStorage.getItem("openId")
                submitAction({
                    content:this.message,
                    name:"搜索",
                    openId:openId,
                    phone:this.tel

                }).then(res=>{
                    console.log(res);
                    if(res.data==true){
                            Toast('提交成功');
                    }else {
                        Toast('提交失败');
                    }
                })
            }
        },

    }
</script>

<style lang="scss" scoped>
* {
    padding: 0;
    margin: 0;
}
        .opinion-title {
            width: 100%;
            font-size: 12px;
            box-sizing: border-box;
            padding: 10px;
            margin-top: 2px;
            margin-bottom: 2px;
            background-color: #fff;
        }
        .van-cell__title .van-field__label {
            text-align: center;
           
        } 
     
       .button {
            margin-top: 30px;
           display: flex;
           justify-content: center;
       }
        .van-button,.van-button--primary,.van-button--large{
            background-color: #b4282d;
            border: 1px solid #b4282d;
            width: 90%;
            margin: 0 auto;
        }
        
</style>